package com.woniuxy.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.woniuxy.dao.VoteOptionDao;
import com.woniuxy.model.VoteOption;
import com.woniuxy.service.VoteOptionService;
import com.woniuxy.util.Result;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author zhouzhou
 * @since 2022-06-23
 */
@Service
public class VoteOptionServiceImpl extends ServiceImpl<VoteOptionDao, VoteOption> implements VoteOptionService {

    @Resource
    VoteOptionService voteOptionService;

    @Override
    public Result getAllTopic(Integer id) {
        List<VoteOption> options = voteOptionService.list(new QueryWrapper<VoteOption>().eq("topic_id",id));
        return Result.success(200,"获取选项成功",options);
    }
}
